package com.ccb.sc.common.modules.luxury.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @since 2020-09-15
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum AcceptWay implements IEnum<Integer> {

    /**
     * 回收方式 0积分回收 1现金回收
     */
    POINT(0, "积分回收"),

    AMOUNT(1, "现金回收"),

    ;

    private int value;
    private String desc;

    AcceptWay(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static AcceptWay getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (AcceptWay acceptWay : AcceptWay.values()) {
            if (acceptWay.getValue() == value.intValue()) {
                return acceptWay;
            }
        }
        return null;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }
}
